package com.frame.service.impl;


import com.frame.domain.Cargo;
import com.frame.mapper.CargoMapper;
import com.frame.service.CargoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CargoServiceImpl implements CargoService {

    @Autowired
    CargoMapper  cargoMapper;


    @Override
    public PageInfo<Cargo> getlist1(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Cargo> list = cargoMapper.getlist1();
        PageInfo<Cargo> cargoPageInfo = new PageInfo<>(list);

        return cargoPageInfo;
    }

    @Override
    public boolean addCargo(Cargo cargo) {
        return cargoMapper.addCargo(cargo);
    }

    @Override
    public boolean updateCargo(Cargo cargo) {

        return cargoMapper.updateCargo(cargo);
    }

    @Override
    public List<Cargo> getProcessList() {
        return cargoMapper.getProcessList();
    }

    @Override
    public List<Cargo> getlist() {
        return cargoMapper.getlist();
    }

    @Override
    public List<Map<String, String>> getlist3() {

        return cargoMapper.getlist3();
    }

    @Override
    public boolean deleteById(Integer id) {
        return cargoMapper.deleyeByid(id);
    }

    @Override
    public List<Cargo> getqslist(Integer id) {
        return cargoMapper.getqslist(id);
    }

    @Override
    public Cargo yunshulist(Integer id) {
        return cargoMapper.yunshulist(id);
    }
}
